Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

request-progress

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

request-progress

Tracks the download progress of a request made with mikeal/request

  • 0.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.6M
increased by3.23%
Maintainers
1
Weekly downloads
 
Created

What is request-progress?

The request-progress npm package is used to track the progress of HTTP requests made using the request library. It provides a simple way to monitor the progress of file uploads and downloads, giving you real-time feedback on the status of your requests.

What are request-progress's main functionalities?

Track Download Progress

This feature allows you to track the progress of a file download. The 'progress' event provides real-time updates on the download status, including the percentage completed, speed, and remaining time.

const request = require('request');
const progress = require('request-progress');

progress(request('http://example.com/file.zip'))
  .on('progress', function (state) {
    console.log('progress', state);
  })
  .on('error', function (err) {
    console.error('error', err);
  })
  .on('end', function () {
    console.log('Download completed');
  });

Track Upload Progress

This feature allows you to track the progress of a file upload. The 'progress' event provides real-time updates on the upload status, including the percentage completed, speed, and remaining time.

const fs = require('fs');
const request = require('request');
const progress = require('request-progress');

const fileStream = fs.createReadStream('path/to/file.zip');

progress(request.post('http://example.com/upload', { formData: { file: fileStream } }))
  .on('progress', function (state) {
    console.log('progress', state);
  })
  .on('error', function (err) {
    console.error('error', err);
  })
  .on('end', function () {
    console.log('Upload completed');
  });

Other packages similar to request-progress

Keywords

FAQs

Package last updated on 28 Aug 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc